package sys.news.filter;

import com.news.vo.HttpServletRequestVo;

import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;

//多路径配置
@WebFilter(urlPatterns = {"/topic.do","/comment.do"})
public class TextFilter implements Filter {
    @Override
    public void init(FilterConfig filterConfig) throws ServletException {

    }

    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        HttpServletRequestVo htv = new HttpServletRequestVo((HttpServletRequest) servletRequest);
        filterChain.doFilter(htv,servletResponse);
    }

    @Override
    public void destroy() {

    }
}
